package com.chuangjiangx.member.manager.web.web.coupon.controller;


import com.chuangjiangx.commons.response.Response;
import com.chuangjiangx.commons.response.ResponseUtils;
import com.chuangjiangx.member.coupon.ddd.application.MbrCouponApplication;
import com.chuangjiangx.member.coupon.ddd.dal.dto.MbrHasCouponDetail;
import com.chuangjiangx.member.coupon.ddd.domain.model.MbrHasCouponId;
import com.chuangjiangx.member.coupon.ddd.query.MbrCouponQuery;
import com.chuangjiangx.member.manager.basic.web.controller.BaseController;
import com.chuangjiangx.member.manager.basic.web.interceptor.Login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员卡卡券
 */
@RestController
@RequestMapping(value = "/api/mbr/mbr-has-coupon", produces = "application/json;charset=UTF-8")
public class MbrHasCouponController extends BaseController {

    @Autowired
    private MbrCouponQuery mbrCouponQuery;
    @Autowired
    private MbrCouponApplication mbrCouponApplication;

    /**
     * 卡券详情-会员领取卡券后的
     *
     */
    @RequestMapping(value = "/detail/{mbrHasCouponId}")
    @Login
    public Response couponDetailInfo(@PathVariable Long mbrHasCouponId) {
        MbrHasCouponDetail mbrHasCouponDetail = mbrCouponQuery.getMbrHasCouponDetail(new MbrHasCouponId(mbrHasCouponId));

        return ResponseUtils.successCamel(mbrHasCouponDetail);
    }



}
